package stringc

import "fmt"

func dealIp(ip string, list []string, res *[][]string) {
	//var res []string

	fmt.Println(ip, list)
	if len(list) == 4  {
		if len(ip) == 0 {
			*res = append(*res, list)
			return
		} else {
			return
		}

	}

	if len(ip) == 0 {
		return
	}

	for i := 1; i < 4; i++ {
		if len(ip) >= i {
			list = append(list, ip[0:i])
			dealIp(ip[i:], list, res)
		}

		//list = append(list, dealIp(ip[i:])...)
	}
	return
}

func validIp(ip string) {
	var (
		list []string
		res [][]string
	)

	dealIp(ip, list, &res)
	fmt.Println(res)
}

//func deal2()

